{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "84d7d44d-2368-4e28-b82e-c937f74bbe64",
   "metadata": {},
   "source": [
    "# Предсказание на X часовых значений вперед"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1b1d0049-ba06-4736-8966-1a7211ff148b",
   "metadata": {},
   "source": [
    "https://regenerativetoday.com/a-step-by-step-tutorial-to-develop-a-multi-output-model-in-tensorflow/"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "acfd9b49-62e7-4601-95ab-25feb4713797",
   "metadata": {},
   "source": [
    "По значениям инструмента на часовом графике попробуем предсказать значения инструмента на определенное количество часов вперед."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "a66f55e5-4118-4749-944b-921c074d3c83",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Количество прогназируемых значений\n",
    "number_of_predicted_values = 15\n",
    "\n",
    "# Значения за сколько часовых наблюдений в прошлом используем для предсказания\n",
    "max_lag = 500\n",
    "\n",
    "RANDOM_STATE = 12345\n",
    "\n",
    "day_features = ['year', 'month', 'day', 'hour', 'dayofweek', 'open', 'low', 'high', 'close', 'volume']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "5f7fd404-e27c-41a8-ba89-441fb9d5d414",
   "metadata": {},
   "outputs": [],
   "source": [
    "#!pip install mplfinance"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "af6da4a4-6acd-4b34-a5b2-c8300e277f44",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "from sqlalchemy import create_engine \n",
    "import seaborn as sns\n",
    "import mplfinance as fplt\n",
    "from statsmodels.tsa.seasonal import seasonal_decompose\n",
    "\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "from sklearn.model_selection import train_test_split\n",
    "from sklearn.linear_model import LinearRegression\n",
    "from sklearn.metrics import mean_absolute_error\n",
    "from sklearn import linear_model\n",
    "from sklearn.metrics import mean_squared_error\n",
    "from sklearn.metrics import r2_score\n",
    "from sklearn.model_selection import train_test_split\n",
    "\n",
    "import re"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "1e8bce6b-f3ce-47b5-a237-8890db3a51af",
   "metadata": {},
   "outputs": [],
   "source": [
    "db_config = {\n",
    "'user': 'loader', # имя пользователя,\n",
    "'pwd': 'pangolin1L', # пароль,\n",
    "'host': 'localhost',\n",
    "'port': 5432, # порт подключения,\n",
    "'db': 'history' # название базы данных,\n",
    "} \n",
    "\n",
    "connection_string = 'postgresql://{}:{}@{}:{}/{}'.format(\n",
    "    db_config['user'],\n",
    "    db_config['pwd'],\n",
    "    db_config['host'],\n",
    "    db_config['port'],\n",
    "    db_config['db'],\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "ce4a4b2b-aafc-4612-8b5d-3e9339c87d04",
   "metadata": {},
   "outputs": [],
   "source": [
    "engine = create_engine(connection_string) "
   ]
  },
  {
   "cell_type": "markdown",
   "id": "cda68fbe-5d89-4220-9d69-9fcb8a876cce",
   "metadata": {},
   "source": [
    "## Все данные"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "7ebc86c8-a7f4-4bce-8ac8-8e5fb27ea147",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>open</th>\n",
       "      <th>low</th>\n",
       "      <th>high</th>\n",
       "      <th>close</th>\n",
       "      <th>volume</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>time</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2024-01-02 07:00:00</th>\n",
       "      <td>1452.8</td>\n",
       "      <td>1452.0</td>\n",
       "      <td>1465.2</td>\n",
       "      <td>1454.0</td>\n",
       "      <td>561</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-01-02 08:00:00</th>\n",
       "      <td>1464.8</td>\n",
       "      <td>1454.0</td>\n",
       "      <td>1466.8</td>\n",
       "      <td>1466.0</td>\n",
       "      <td>659</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-01-02 09:00:00</th>\n",
       "      <td>1463.8</td>\n",
       "      <td>1461.0</td>\n",
       "      <td>1472.0</td>\n",
       "      <td>1472.0</td>\n",
       "      <td>835</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-01-02 10:00:00</th>\n",
       "      <td>1472.0</td>\n",
       "      <td>1465.0</td>\n",
       "      <td>1472.6</td>\n",
       "      <td>1472.0</td>\n",
       "      <td>640</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-01-02 11:00:00</th>\n",
       "      <td>1469.4</td>\n",
       "      <td>1464.0</td>\n",
       "      <td>1473.4</td>\n",
       "      <td>1473.0</td>\n",
       "      <td>473</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                       open     low    high   close  volume\n",
       "time                                                       \n",
       "2024-01-02 07:00:00  1452.8  1452.0  1465.2  1454.0     561\n",
       "2024-01-02 08:00:00  1464.8  1454.0  1466.8  1466.0     659\n",
       "2024-01-02 09:00:00  1463.8  1461.0  1472.0  1472.0     835\n",
       "2024-01-02 10:00:00  1472.0  1465.0  1472.6  1472.0     640\n",
       "2024-01-02 11:00:00  1469.4  1464.0  1473.4  1473.0     473"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "query = '''\n",
    "SELECT time, open, low, high, close, volume FROM public.candle\n",
    "where ticker='NVTK'\n",
    "'''\n",
    "df = pd.read_sql_query(query, con=engine, index_col='time', parse_dates='time')\n",
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "8d46a4dc-26d2-4ae6-a8eb-c43ea8f27f4b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>open</th>\n",
       "      <th>low</th>\n",
       "      <th>high</th>\n",
       "      <th>close</th>\n",
       "      <th>volume</th>\n",
       "      <th>year</th>\n",
       "      <th>month</th>\n",
       "      <th>day</th>\n",
       "      <th>dayofweek</th>\n",
       "      <th>hour</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>time</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2024-06-18 11:00:00</th>\n",
       "      <td>1055.6</td>\n",
       "      <td>1044.0</td>\n",
       "      <td>1057.6</td>\n",
       "      <td>1046.0</td>\n",
       "      <td>318101</td>\n",
       "      <td>2024</td>\n",
       "      <td>6</td>\n",
       "      <td>18</td>\n",
       "      <td>1</td>\n",
       "      <td>11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-04-02 11:00:00</th>\n",
       "      <td>1287.4</td>\n",
       "      <td>1284.0</td>\n",
       "      <td>1289.6</td>\n",
       "      <td>1288.0</td>\n",
       "      <td>155574</td>\n",
       "      <td>2024</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-02-18 10:00:00</th>\n",
       "      <td>1411.6</td>\n",
       "      <td>1411.0</td>\n",
       "      <td>1414.0</td>\n",
       "      <td>1414.0</td>\n",
       "      <td>1452</td>\n",
       "      <td>2024</td>\n",
       "      <td>2</td>\n",
       "      <td>18</td>\n",
       "      <td>6</td>\n",
       "      <td>10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-04-27 18:00:00</th>\n",
       "      <td>1231.8</td>\n",
       "      <td>1230.0</td>\n",
       "      <td>1232.6</td>\n",
       "      <td>1232.0</td>\n",
       "      <td>37597</td>\n",
       "      <td>2024</td>\n",
       "      <td>4</td>\n",
       "      <td>27</td>\n",
       "      <td>5</td>\n",
       "      <td>18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-04-28 20:00:00</th>\n",
       "      <td>1229.4</td>\n",
       "      <td>1226.0</td>\n",
       "      <td>1229.4</td>\n",
       "      <td>1228.0</td>\n",
       "      <td>2988</td>\n",
       "      <td>2024</td>\n",
       "      <td>4</td>\n",
       "      <td>28</td>\n",
       "      <td>6</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                       open     low    high   close  volume  year  month  day  \\\n",
       "time                                                                            \n",
       "2024-06-18 11:00:00  1055.6  1044.0  1057.6  1046.0  318101  2024      6   18   \n",
       "2024-04-02 11:00:00  1287.4  1284.0  1289.6  1288.0  155574  2024      4    2   \n",
       "2024-02-18 10:00:00  1411.6  1411.0  1414.0  1414.0    1452  2024      2   18   \n",
       "2024-04-27 18:00:00  1231.8  1230.0  1232.6  1232.0   37597  2024      4   27   \n",
       "2024-04-28 20:00:00  1229.4  1226.0  1229.4  1228.0    2988  2024      4   28   \n",
       "\n",
       "                     dayofweek  hour  \n",
       "time                                  \n",
       "2024-06-18 11:00:00          1    11  \n",
       "2024-04-02 11:00:00          1    11  \n",
       "2024-02-18 10:00:00          6    10  \n",
       "2024-04-27 18:00:00          5    18  \n",
       "2024-04-28 20:00:00          6    20  "
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['year'] = df.index.year\n",
    "df['month'] = df.index.month\n",
    "df['day'] = df.index.day\n",
    "df['dayofweek'] = df.index.dayofweek\n",
    "df['hour'] = df.index.hour\n",
    "df.sample(5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "8ce0e30c-321d-4545-8841-9959400ff44f",
   "metadata": {},
   "outputs": [],
   "source": [
    "df = df[['year', 'month', 'day', 'dayofweek', 'hour', 'open', 'low', 'high', 'close', 'volume']]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "a00276a0-e2e4-4e30-95b0-2f89682b241a",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:5: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:6: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:7: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:8: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:9: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:11: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:12: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:13: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:14: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
      "/tmp/ipykernel_27593/1234592443.py:15: PerformanceWarning: DataFrame is highly fragmented.  This is usually the result of calling `frame.insert` many times, which has poor performance.  Consider joining all columns at once using pd.concat(axis=1) instead. To get a de-fragmented frame, use `newframe = frame.copy()`\n",
      "  df['volume_l{}'.format(lag)] = df['volume'].shift(lag)\n"
     ]
    }
   ],
   "source": [
    "# О методе shift https://teletype.in/@pythontalk/pandas_shift\n",
    "\n",
    "for lag in range(1, max_lag + 1):    \n",
    "    \n",
    "    df['year_l{}'.format(lag)] = df['year'].shift(lag)\n",
    "    df['month_l{}'.format(lag)] = df['month'].shift(lag)\n",
    "    df['day_l{}'.format(lag)] = df['day'].shift(lag)\n",
    "    df['dayofweek_l{}'.format(lag)] = df['dayofweek'].shift(lag)\n",
    "    df['hour_l{}'.format(lag)] = df['hour'].shift(lag)\n",
    "    \n",
    "    df['open_l{}'.format(lag)] = df['open'].shift(lag)\n",
    "    df['low_l{}'.format(lag)] = df['low'].shift(lag)\n",
    "    df['high_l{}'.format(lag)] = df['high'].shift(lag)\n",
    "    df['close_l{}'.format(lag)] = df['close'].shift(lag)\n",
    "    df['volume_l{}'.format(lag)] = df['volume'].shift(lag)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "2c19f9df-11e6-4d4c-bfd4-af68897cec28",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>year</th>\n",
       "      <th>month</th>\n",
       "      <th>day</th>\n",
       "      <th>dayofweek</th>\n",
       "      <th>hour</th>\n",
       "      <th>open</th>\n",
       "      <th>low</th>\n",
       "      <th>high</th>\n",
       "      <th>close</th>\n",
       "      <th>volume</th>\n",
       "      <th>year_l1</th>\n",
       "      <th>month_l1</th>\n",
       "      <th>day_l1</th>\n",
       "      <th>dayofweek_l1</th>\n",
       "      <th>hour_l1</th>\n",
       "      <th>open_l1</th>\n",
       "      <th>low_l1</th>\n",
       "      <th>high_l1</th>\n",
       "      <th>close_l1</th>\n",
       "      <th>volume_l1</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>time</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2024-01-02 07:00:00</th>\n",
       "      <td>2024</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>7</td>\n",
       "      <td>1452.8</td>\n",
       "      <td>1452.0</td>\n",
       "      <td>1465.2</td>\n",
       "      <td>1454.0</td>\n",
       "      <td>561</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-01-02 08:00:00</th>\n",
       "      <td>2024</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>8</td>\n",
       "      <td>1464.8</td>\n",
       "      <td>1454.0</td>\n",
       "      <td>1466.8</td>\n",
       "      <td>1466.0</td>\n",
       "      <td>659</td>\n",
       "      <td>2024.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>7.0</td>\n",
       "      <td>1452.8</td>\n",
       "      <td>1452.0</td>\n",
       "      <td>1465.2</td>\n",
       "      <td>1454.0</td>\n",
       "      <td>561.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-01-02 09:00:00</th>\n",
       "      <td>2024</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>9</td>\n",
       "      <td>1463.8</td>\n",
       "      <td>1461.0</td>\n",
       "      <td>1472.0</td>\n",
       "      <td>1472.0</td>\n",
       "      <td>835</td>\n",
       "      <td>2024.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>8.0</td>\n",
       "      <td>1464.8</td>\n",
       "      <td>1454.0</td>\n",
       "      <td>1466.8</td>\n",
       "      <td>1466.0</td>\n",
       "      <td>659.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-01-02 10:00:00</th>\n",
       "      <td>2024</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>10</td>\n",
       "      <td>1472.0</td>\n",
       "      <td>1465.0</td>\n",
       "      <td>1472.6</td>\n",
       "      <td>1472.0</td>\n",
       "      <td>640</td>\n",
       "      <td>2024.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>1463.8</td>\n",
       "      <td>1461.0</td>\n",
       "      <td>1472.0</td>\n",
       "      <td>1472.0</td>\n",
       "      <td>835.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-01-02 11:00:00</th>\n",
       "      <td>2024</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>11</td>\n",
       "      <td>1469.4</td>\n",
       "      <td>1464.0</td>\n",
       "      <td>1473.4</td>\n",
       "      <td>1473.0</td>\n",
       "      <td>473</td>\n",
       "      <td>2024.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>10.0</td>\n",
       "      <td>1472.0</td>\n",
       "      <td>1465.0</td>\n",
       "      <td>1472.6</td>\n",
       "      <td>1472.0</td>\n",
       "      <td>640.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                     year  month  day  dayofweek  hour    open     low  \\\n",
       "time                                                                     \n",
       "2024-01-02 07:00:00  2024      1    2          1     7  1452.8  1452.0   \n",
       "2024-01-02 08:00:00  2024      1    2          1     8  1464.8  1454.0   \n",
       "2024-01-02 09:00:00  2024      1    2          1     9  1463.8  1461.0   \n",
       "2024-01-02 10:00:00  2024      1    2          1    10  1472.0  1465.0   \n",
       "2024-01-02 11:00:00  2024      1    2          1    11  1469.4  1464.0   \n",
       "\n",
       "                       high   close  volume  year_l1  month_l1  day_l1  \\\n",
       "time                                                                     \n",
       "2024-01-02 07:00:00  1465.2  1454.0     561      NaN       NaN     NaN   \n",
       "2024-01-02 08:00:00  1466.8  1466.0     659   2024.0       1.0     2.0   \n",
       "2024-01-02 09:00:00  1472.0  1472.0     835   2024.0       1.0     2.0   \n",
       "2024-01-02 10:00:00  1472.6  1472.0     640   2024.0       1.0     2.0   \n",
       "2024-01-02 11:00:00  1473.4  1473.0     473   2024.0       1.0     2.0   \n",
       "\n",
       "                     dayofweek_l1  hour_l1  open_l1  low_l1  high_l1  \\\n",
       "time                                                                   \n",
       "2024-01-02 07:00:00           NaN      NaN      NaN     NaN      NaN   \n",
       "2024-01-02 08:00:00           1.0      7.0   1452.8  1452.0   1465.2   \n",
       "2024-01-02 09:00:00           1.0      8.0   1464.8  1454.0   1466.8   \n",
       "2024-01-02 10:00:00           1.0      9.0   1463.8  1461.0   1472.0   \n",
       "2024-01-02 11:00:00           1.0     10.0   1472.0  1465.0   1472.6   \n",
       "\n",
       "                     close_l1  volume_l1  \n",
       "time                                      \n",
       "2024-01-02 07:00:00       NaN        NaN  \n",
       "2024-01-02 08:00:00    1454.0      561.0  \n",
       "2024-01-02 09:00:00    1466.0      659.0  \n",
       "2024-01-02 10:00:00    1472.0      835.0  \n",
       "2024-01-02 11:00:00    1472.0      640.0  "
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head().iloc[:, :20]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "f0a0241c-5132-46cc-8287-bc147bd1d28a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(2456, 5010)"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "b58f4f3b-4250-49a8-9b1f-4fcf66955129",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(1956, 5010)"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = df.dropna()\n",
    "df.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "id": "bdf9a990-138d-471c-ba22-7c8ac360ee77",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['year', 'month', 'day', 'hour', 'dayofweek', 'open', 'low', 'high', 'close', 'volume', 'year_l1', 'month_l1', 'day_l1', 'hour_l1', 'dayofweek_l1', 'open_l1', 'low_l1', 'high_l1', 'close_l1', 'volume_l1', 'year_l2', 'month_l2', 'day_l2', 'hour_l2', 'dayofweek_l2', 'open_l2', 'low_l2', 'high_l2', 'close_l2', 'volume_l2', 'year_l3', 'month_l3', 'day_l3', 'hour_l3', 'dayofweek_l3', 'open_l3', 'low_l3', 'high_l3', 'close_l3', 'volume_l3', 'year_l4', 'month_l4', 'day_l4', 'hour_l4', 'dayofweek_l4', 'open_l4', 'low_l4', 'high_l4', 'close_l4', 'volume_l4', 'year_l5', 'month_l5', 'day_l5', 'hour_l5', 'dayofweek_l5', 'open_l5', 'low_l5', 'high_l5', 'close_l5', 'volume_l5', 'year_l6', 'month_l6', 'day_l6', 'hour_l6', 'dayofweek_l6', 'open_l6', 'low_l6', 'high_l6', 'close_l6', 'volume_l6', 'year_l7', 'month_l7', 'day_l7', 'hour_l7', 'dayofweek_l7', 'open_l7', 'low_l7', 'high_l7', 'close_l7', 'volume_l7', 'year_l8', 'month_l8', 'day_l8', 'hour_l8', 'dayofweek_l8', 'open_l8', 'low_l8', 'high_l8', 'close_l8', 'volume_l8', 'year_l9', 'month_l9', 'day_l9', 'hour_l9', 'dayofweek_l9', 'open_l9', 'low_l9', 'high_l9', 'close_l9', 'volume_l9', 'year_l10', 'month_l10', 'day_l10', 'hour_l10', 'dayofweek_l10', 'open_l10', 'low_l10', 'high_l10', 'close_l10', 'volume_l10', 'year_l11', 'month_l11', 'day_l11', 'hour_l11', 'dayofweek_l11', 'open_l11', 'low_l11', 'high_l11', 'close_l11', 'volume_l11', 'year_l12', 'month_l12', 'day_l12', 'hour_l12', 'dayofweek_l12', 'open_l12', 'low_l12', 'high_l12', 'close_l12', 'volume_l12', 'year_l13', 'month_l13', 'day_l13', 'hour_l13', 'dayofweek_l13', 'open_l13', 'low_l13', 'high_l13', 'close_l13', 'volume_l13', 'year_l14', 'month_l14', 'day_l14', 'hour_l14', 'dayofweek_l14', 'open_l14', 'low_l14', 'high_l14', 'close_l14', 'volume_l14']\n"
     ]
    }
   ],
   "source": [
    "# Получаем список столбцов, которые должны быть удалены из фич, чтобы не было утечки данных при обучении\n",
    "\n",
    "def get_columns_with_lags(values, number_of_predicted_values):\n",
    "    result = values[:]\n",
    "    for i in range(1, number_of_predicted_values):\n",
    "        for value in values:\n",
    "            new_value = f\"{value}_l{i}\"\n",
    "            result.append(new_value)\n",
    "    return result\n",
    "\n",
    "columns_to_drop = get_columns_with_lags(day_features, number_of_predicted_values)\n",
    "print(columns_to_drop)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "id": "6ba86a94-3484-458c-a6e2-4954ab47117c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['close',\n",
       " 'close_l1',\n",
       " 'close_l2',\n",
       " 'close_l3',\n",
       " 'close_l4',\n",
       " 'close_l5',\n",
       " 'close_l6',\n",
       " 'close_l7',\n",
       " 'close_l8',\n",
       " 'close_l9',\n",
       " 'close_l10',\n",
       " 'close_l11',\n",
       " 'close_l12',\n",
       " 'close_l13',\n",
       " 'close_l14']"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "close_columns = get_columns_with_lags(['close'], number_of_predicted_values)\n",
    "close_columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "id": "aa875664-2525-478e-af3e-b900c18c316f",
   "metadata": {},
   "outputs": [],
   "source": [
    "train_and_valid, test = train_test_split(df, shuffle=True, test_size = 0.2, random_state = RANDOM_STATE)\n",
    "train, valid = train_test_split(train_and_valid, test_size = 0.25, random_state = RANDOM_STATE)\n",
    "\n",
    "target_train = train[close_columns]\n",
    "features_train = train.drop(columns_to_drop, axis = 1)\n",
    "\n",
    "target_valid = valid[close_columns]\n",
    "features_valid = valid.drop(columns_to_drop, axis = 1)\n",
    "\n",
    "target_test = test[close_columns]\n",
    "features_test = test.drop(columns_to_drop, axis = 1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "id": "82a44cc7-86de-42fb-bd12-4b6c200fe831",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>year_l15</th>\n",
       "      <th>month_l15</th>\n",
       "      <th>day_l15</th>\n",
       "      <th>dayofweek_l15</th>\n",
       "      <th>hour_l15</th>\n",
       "      <th>open_l15</th>\n",
       "      <th>low_l15</th>\n",
       "      <th>high_l15</th>\n",
       "      <th>close_l15</th>\n",
       "      <th>volume_l15</th>\n",
       "      <th>...</th>\n",
       "      <th>year_l500</th>\n",
       "      <th>month_l500</th>\n",
       "      <th>day_l500</th>\n",
       "      <th>dayofweek_l500</th>\n",
       "      <th>hour_l500</th>\n",
       "      <th>open_l500</th>\n",
       "      <th>low_l500</th>\n",
       "      <th>high_l500</th>\n",
       "      <th>close_l500</th>\n",
       "      <th>volume_l500</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>time</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2024-02-10 09:00:00</th>\n",
       "      <td>2024.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>8.0</td>\n",
       "      <td>1443.8</td>\n",
       "      <td>1442.0</td>\n",
       "      <td>1455.4</td>\n",
       "      <td>1452.0</td>\n",
       "      <td>87419.0</td>\n",
       "      <td>...</td>\n",
       "      <td>2024.0</td>\n",
       "      <td>1.0</td>\n",
       "      <td>3.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>18.0</td>\n",
       "      <td>1482.0</td>\n",
       "      <td>1481.0</td>\n",
       "      <td>1482.8</td>\n",
       "      <td>1482.0</td>\n",
       "      <td>2675.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1 rows × 4860 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                     year_l15  month_l15  day_l15  dayofweek_l15  hour_l15  \\\n",
       "time                                                                         \n",
       "2024-02-10 09:00:00    2024.0        2.0      9.0            4.0       8.0   \n",
       "\n",
       "                     open_l15  low_l15  high_l15  close_l15  volume_l15  ...  \\\n",
       "time                                                                     ...   \n",
       "2024-02-10 09:00:00    1443.8   1442.0    1455.4     1452.0     87419.0  ...   \n",
       "\n",
       "                     year_l500  month_l500  day_l500  dayofweek_l500  \\\n",
       "time                                                                   \n",
       "2024-02-10 09:00:00     2024.0         1.0       3.0             2.0   \n",
       "\n",
       "                     hour_l500  open_l500  low_l500  high_l500  close_l500  \\\n",
       "time                                                                         \n",
       "2024-02-10 09:00:00       18.0     1482.0    1481.0     1482.8      1482.0   \n",
       "\n",
       "                     volume_l500  \n",
       "time                              \n",
       "2024-02-10 09:00:00       2675.0  \n",
       "\n",
       "[1 rows x 4860 columns]"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "features_test.tail(1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "id": "f694f73c-b7df-458f-b033-0e2b6ace2c94",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>close</th>\n",
       "      <th>close_l1</th>\n",
       "      <th>close_l2</th>\n",
       "      <th>close_l3</th>\n",
       "      <th>close_l4</th>\n",
       "      <th>close_l5</th>\n",
       "      <th>close_l6</th>\n",
       "      <th>close_l7</th>\n",
       "      <th>close_l8</th>\n",
       "      <th>close_l9</th>\n",
       "      <th>close_l10</th>\n",
       "      <th>close_l11</th>\n",
       "      <th>close_l12</th>\n",
       "      <th>close_l13</th>\n",
       "      <th>close_l14</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>time</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2024-03-16 13:00:00</th>\n",
       "      <td>1402.0</td>\n",
       "      <td>1402.0</td>\n",
       "      <td>1402.0</td>\n",
       "      <td>1402.0</td>\n",
       "      <td>1402.0</td>\n",
       "      <td>1400.0</td>\n",
       "      <td>1402.0</td>\n",
       "      <td>1400.0</td>\n",
       "      <td>1401.0</td>\n",
       "      <td>1400.0</td>\n",
       "      <td>1402.0</td>\n",
       "      <td>1401.0</td>\n",
       "      <td>1402.0</td>\n",
       "      <td>1404.0</td>\n",
       "      <td>1402.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                      close  close_l1  close_l2  close_l3  close_l4  close_l5  \\\n",
       "time                                                                            \n",
       "2024-03-16 13:00:00  1402.0    1402.0    1402.0    1402.0    1402.0    1400.0   \n",
       "\n",
       "                     close_l6  close_l7  close_l8  close_l9  close_l10  \\\n",
       "time                                                                     \n",
       "2024-03-16 13:00:00    1402.0    1400.0    1401.0    1400.0     1402.0   \n",
       "\n",
       "                     close_l11  close_l12  close_l13  close_l14  \n",
       "time                                                             \n",
       "2024-03-16 13:00:00     1401.0     1402.0     1404.0     1402.0  "
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "target_train.tail(1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "id": "2ae72d9b-a507-4f6c-ac2d-a2dcf14243bd",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Приведем столбцы, начинающиеся на 'year', 'month', 'day', 'dayofweek', 'hour' к целому типу int\n",
    "\n",
    "cat_columns_condition = col.startswith('year') or \\\n",
    "                        col.startswith('month') or \\\n",
    "                        col.startswith('day') or \\\n",
    "                        col.startswith('dayofweek') or \\\n",
    "                        col.startswith('hour')\n",
    "\n",
    "for col in features_train.columns:\n",
    "    if cat_columns_condition:\n",
    "        features_train[col] = features_train[col].astype(int)\n",
    "\n",
    "for col in features_valid.columns:\n",
    "    if cat_columns_condition:\n",
    "        features_valid[col] = features_valid[col].astype(int)\n",
    "\n",
    "for col in features_test.columns:\n",
    "    if cat_columns_condition:\n",
    "        features_test[col] = features_test[col].astype(int)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "id": "0287975d-c787-49db-a663-90d954423a3a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>year_l15</th>\n",
       "      <th>month_l15</th>\n",
       "      <th>day_l15</th>\n",
       "      <th>dayofweek_l15</th>\n",
       "      <th>hour_l15</th>\n",
       "      <th>open_l15</th>\n",
       "      <th>low_l15</th>\n",
       "      <th>high_l15</th>\n",
       "      <th>close_l15</th>\n",
       "      <th>volume_l15</th>\n",
       "      <th>...</th>\n",
       "      <th>year_l500</th>\n",
       "      <th>month_l500</th>\n",
       "      <th>day_l500</th>\n",
       "      <th>dayofweek_l500</th>\n",
       "      <th>hour_l500</th>\n",
       "      <th>open_l500</th>\n",
       "      <th>low_l500</th>\n",
       "      <th>high_l500</th>\n",
       "      <th>close_l500</th>\n",
       "      <th>volume_l500</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>time</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2024-02-10 09:00:00</th>\n",
       "      <td>2024</td>\n",
       "      <td>2</td>\n",
       "      <td>9</td>\n",
       "      <td>4</td>\n",
       "      <td>8</td>\n",
       "      <td>1443.8</td>\n",
       "      <td>1442.0</td>\n",
       "      <td>1455.4</td>\n",
       "      <td>1452.0</td>\n",
       "      <td>87419.0</td>\n",
       "      <td>...</td>\n",
       "      <td>2024</td>\n",
       "      <td>1</td>\n",
       "      <td>3</td>\n",
       "      <td>2</td>\n",
       "      <td>18</td>\n",
       "      <td>1482.0</td>\n",
       "      <td>1481.0</td>\n",
       "      <td>1482.8</td>\n",
       "      <td>1482.0</td>\n",
       "      <td>2675.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1 rows × 4860 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                     year_l15  month_l15  day_l15  dayofweek_l15  hour_l15  \\\n",
       "time                                                                         \n",
       "2024-02-10 09:00:00      2024          2        9              4         8   \n",
       "\n",
       "                     open_l15  low_l15  high_l15  close_l15  volume_l15  ...  \\\n",
       "time                                                                     ...   \n",
       "2024-02-10 09:00:00    1443.8   1442.0    1455.4     1452.0     87419.0  ...   \n",
       "\n",
       "                     year_l500  month_l500  day_l500  dayofweek_l500  \\\n",
       "time                                                                   \n",
       "2024-02-10 09:00:00       2024           1         3               2   \n",
       "\n",
       "                     hour_l500  open_l500  low_l500  high_l500  close_l500  \\\n",
       "time                                                                         \n",
       "2024-02-10 09:00:00         18     1482.0    1481.0     1482.8      1482.0   \n",
       "\n",
       "                     volume_l500  \n",
       "time                              \n",
       "2024-02-10 09:00:00       2675.0  \n",
       "\n",
       "[1 rows x 4860 columns]"
      ]
     },
     "execution_count": 60,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "features_test.tail(1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7f4e1c5d-df8c-4ac7-813f-5a67a0e2662b",
   "metadata": {},
   "outputs": [],
   "source": [
    "model = linear_model.Lasso(alpha=0.1, max_iter=1000)\n",
    "model.fit(features_train, target_train)\n",
    "\n",
    "pred_train = model.predict(features_train)\n",
    "pred_test = model.predict(features_test)\n",
    "\n",
    "print(\"MAE обучающей выборки:\", mean_absolute_error(target_train, pred_train))\n",
    "print(\"MAE тестовой выборки: \", mean_absolute_error(target_test, pred_test))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a15093aa-cf06-4537-9dde-e272b8a6a2ef",
   "metadata": {},
   "outputs": [],
   "source": [
    "mse = mean_squared_error(target_test, pred_test)\n",
    "print(\"RMSE =\", mse ** 0.5)\n",
    "print(\"R2 =\", r2_score(target_test, pred_test))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d0884ec1-3a5a-4fed-8298-ce623009ac48",
   "metadata": {},
   "outputs": [],
   "source": [
    "pred_test[-1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f5f96f70-d1d9-45f1-93d6-43269d96c628",
   "metadata": {},
   "outputs": [],
   "source": [
    "target_test[-1]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "290821bf-1878-47a6-87fc-9f3a05140acb",
   "metadata": {},
   "source": [
    "## Предсказание значения для следующего часа"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f27c8bf8-6df6-4c6f-9489-6884d921a379",
   "metadata": {},
   "outputs": [],
   "source": [
    "def extract_number_from_key(key):\n",
    "    # Регулярное выражение для поиска числа после '_l'\n",
    "    pattern = r'_l(\\d+)$'\n",
    "    \n",
    "    # Поиск соответствия регулярному выражению в строке\n",
    "    match = re.search(pattern, key)\n",
    "    \n",
    "    if match:\n",
    "        # Возвращаем найденное число\n",
    "        return match.group(1)\n",
    "    else:\n",
    "        # Если число не найдено, возвращаем None\n",
    "        return None\n",
    "\n",
    "# Пример использования функции\n",
    "#key = \"example_key_l42\"\n",
    "#number = extract_number_from_key(key)\n",
    "#print(number)  # Выведет '42'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e21c87aa-c434-45e4-a27e-59c3a769e247",
   "metadata": {},
   "outputs": [],
   "source": [
    "last_row1 = df.tail(1).iloc[0]\n",
    "new_row = {}\n",
    "\n",
    "for key, value in last_row1.items():\n",
    "    number = extract_number_from_key(key)\n",
    "    if number is None:\n",
    "        if key == \"dayofweek\" or key == \"year\" or key == \"month\" or key == \"day\" or key == \"hour\":\n",
    "            new_key = key            \n",
    "            new_row[new_key] = value\n",
    "            print(f\"{key} -> {new_key} : {value}\")        \n",
    "\n",
    "last_row2 = df.tail(1).iloc[0]\n",
    "for key, value in last_row2.items():\n",
    "    number = extract_number_from_key(key)\n",
    "    if number is None:\n",
    "        if key == \"open\":\n",
    "            new_key = \"open_l1\"\n",
    "            new_row[new_key] = value\n",
    "            print(f\"{key} -> {new_key} : {value}\")\n",
    "            \n",
    "        if key == \"low\":\n",
    "            new_key = \"low_l1\"\n",
    "            new_row[new_key] = value\n",
    "            print(f\"{key} -> {new_key} : {value}\")\n",
    "            \n",
    "        if key == \"high\":\n",
    "            new_key = \"high_l1\"\n",
    "            new_row[new_key] = value\n",
    "            print(f\"{key} -> {new_key} : {value}\")\n",
    "            \n",
    "        if key == \"close\":\n",
    "            new_key = \"close_l1\" \n",
    "            new_row[new_key] = value\n",
    "            print(f\"{key} -> {new_key} : {value}\")\n",
    "            \n",
    "        if key == \"volume\":\n",
    "            new_key = \"volume_l1\"\n",
    "            new_row[new_key] = value\n",
    "            print(f\"{key} -> {new_key} : {value}\")            \n",
    "    else: \n",
    "        next_number = int(number) + 1\n",
    "        if next_number <= max_lag:\n",
    "            new_key = key.replace(str(number), str(next_number))        \n",
    "            new_row[new_key] = value    \n",
    "            print(f\"{key} -> {new_key} : {value}\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a7295bd1-6d92-46d6-b4d4-4d57bbb1e8ba",
   "metadata": {},
   "outputs": [],
   "source": [
    "df2 = pd.DataFrame.from_dict(new_row, orient='index').T\n",
    "df2.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c7e7e7b5-2cf9-48b7-b7cd-704d03aaa434",
   "metadata": {},
   "outputs": [],
   "source": [
    "pred_next_hour = model.predict(df2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2ac0b4dc-06df-4c81-9090-380649cff7ac",
   "metadata": {},
   "outputs": [],
   "source": [
    "pred_next_hour[0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c6757016-1c4d-440b-95fb-155500af1d8e",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
